home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / LENSGRID.PI < prev    next >
Text File  |  1992-09-20  |  2KB  |  66 lines

  1. // File demonstrating refraction, CSG, etc.
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. //start_frame 0
  5. //total_frames 20
  6. //outfile lens
  7.  
  8. // Define the position of the eye based on the frame number
  9. define eye_x_pos 0
  10. //define eye_x_pos frame / 2 - 5
  11. define eye_height 4
  12. define eye_dist 10
  13.  
  14. viewpoint {
  15.    from <eye_x_pos,eye_height,-eye_dist>
  16.    at <0,0,0>
  17.    up <0,1,0>
  18.    angle 35
  19.    resolution 320, 320
  20.    }
  21.  
  22. background <0.196078, 0.6, 0.8>
  23. light <-10,10,-10>
  24. include "..\colors.inc"
  25.  
  26. // Make a convex lens by intersecting two spheres
  27. define convex_lens
  28. object {
  29.      object { sphere <0,0,-0.5>, 1 }
  30.    * object { sphere <0,0, 0.5>, 1 }
  31.    glass
  32.    }
  33.  
  34. // Put two lenses in line - with two lenses the magnified image
  35. // will end up right-side-up.
  36. convex_lens {
  37.    rotate <degrees(atan(eye_height/eye_dist)),0,0>
  38.    translate <0,eye_height/8,-eye_dist/8>
  39.    }
  40. convex_lens {
  41.    rotate <degrees(atan(eye_height/eye_dist)),0,0>
  42.    translate <0,eye_height/2,-eye_dist/2>
  43.    }
  44.  
  45. // Create a ground plane
  46. object {
  47.    disc <0, -1.001, 0>, <0, 1, 0>, 500
  48.    texture { checker matte_white, matte_black }
  49.    }
  50.  
  51. // Make a bunch of little colored balls on the ground
  52. define little_ball object { sphere <0.5, 0.3, 0.5>, 0.3 }
  53.  
  54. object {
  55.    gridded "grdimg1.tga",
  56.       little_ball { matte_red }
  57.       little_ball { matte_yellow }
  58.       little_ball { matte_green }
  59.       little_ball { matte_cyan }
  60.       little_ball { matte_blue }
  61.       little_ball { matte_magenta }
  62.    translate <-8, 0, -8>
  63.    scale <0.5, 0.5, 0.5>
  64.    translate <0, -1, 0>
  65.    }
  66.